package com.fira.api.controller;

import com.fira.common.core.domain.AjaxResult;
import com.fira.common.utils.StringUtils;
import com.fira.platform.service.IPlatformTenantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 租户信息查询接口
 * @author tony
 * @date 2021-10-14
 */
@Api(value="家长中心接口",tags={"家长中心"})
@Controller
@RequestMapping("/api/tenant")
public class TenantController extends ApiController{
    @Autowired
    private IPlatformTenantService platformTenantService;

    @ApiOperation(value="查询租户信息",tags={"查询租户信息"},notes="")
    @PostMapping("/info")
    @ResponseBody
    public AjaxResult getTenantInfo(String tenantId){
        if(StringUtils.isEmpty(tenantId)){
            return AjaxResult.error("租户ID不能为空");
        }
        return AjaxResult.success("查询成功",platformTenantService.selectPlatformTenantById(tenantId));
    }
}
